/*
** incan_more.c for incan_more in /home/vriely/Dropbox/work/Unix/Zappy_rendu/serv-src
**
** Made by Samuel Vrielynck
** Login   <vriely_s@epitech.net>
**
** Started on  Wed Jul 04 20:47:35 2012 Samuel Vrielynck
** Last update Thu Jul 19 17:44:51 2012 pierrick druart
*/

#include	"server.h"

void		send_data_incan(t_client *graphic, t_incantation *inca,
    int fail)
{
  if (graphic)
  {
    graphic->send->concat(graphic->send, "pie ");
    graphic->send->concat_value(graphic->send, inca->coord.x);
    graphic->send->concat(graphic->send, " ");
    graphic->send->concat_value(graphic->send, inca->coord.y);
    graphic->send->concat(graphic->send, " ");
    graphic->send->concat_value(graphic->send, fail);
    graphic->send->concat(graphic->send, "\n");
  }
}

void		foreach_inc_lvl(void *content, void *data)
{
  t_client	*client;

  (void)data;
  client = (t_client *)content;
  client->gamer->level++;
  client->send->concat(client->send, "niveau actuel : ");
  client->send->concat_value(client->send, client->gamer->level);
  client->send->concat(client->send, "\n");
  if (client->gamer->level == 8)
    client->gamer->team->nb_maxlvl++;
}

void		foreach_inc_fail(void *content, void *data)
{
  t_client	*client;

  (void)data;
  client = (struct s_client *)content;
  client->send->concat(client->send, "ko\n");
}
